// IE5Events.cpp : implementation file
//

#include "stdafx.h"
#include "vfwcap.h"
#include "IE5Events.h"
#include "vfwcapDlg.h"

#include <ExDisp.h>  // Contains declaration for IWebBrowser2
#include <EXDISPID.H> 

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// IE5Events

IMPLEMENT_DYNCREATE(CIE5Events, CCmdTarget)

CIE5Events::CIE5Events(CVfwcapDlg * pParent /* = NULL */) : m_pParent(pParent)
{
	ASSERT(m_pParent);
	
	EnableAutomation();  // Needed in order to sink events.
}

CIE5Events::~CIE5Events()
{
}


BEGIN_MESSAGE_MAP(CIE5Events, CCmdTarget)
//{{AFX_MSG_MAP(CIE5Events)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

BEGIN_DISPATCH_MAP(CIE5Events, CCmdTarget)

DISP_FUNCTION_ID(CIE5Events, "OnQuit", DISPID_ONQUIT, OnQuit, VT_EMPTY, VTS_NONE)

END_DISPATCH_MAP()

//
// Add DIID_DWebBrowserEvents2 to the interface map to tell
// Internet Explorer that you support this event sink.  
// Internet Explorer will query for this interface when 
// you call AfxConnectionAdvise.  If Internet Explorer
// does not find this interface, it will then query for IDispatch.
//
BEGIN_INTERFACE_MAP(CIE5Events, CCmdTarget)
INTERFACE_PART(CIE5Events, DIID_DWebBrowserEvents2, Dispatch)
END_INTERFACE_MAP()

/////////////////////////////////////////////////////////////////////////////
// CIE5Events event handlers


void CIE5Events::OnQuit()
{
	//	m_pParent->AddEventToList(CMFCIEEvtSpyDlg::IE5ListBox, "Quit");
	m_pParent->OnIE5Quit();
	
	
}
